﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dillema.example_to_agents
{
    class PasswordBaseStategy1 : Agent
    {
        bool[] password = { false, true, true, false, true};
        int turn = 0;
        bool isEnemy = false;

        public bool Response(bool last_action)
        {
            if (isEnemy)
                return false;

            if (turn >= password.Length)
                return true;

            if (last_action != password[turn])
                isEnemy = true;

            turn++;

            if (isEnemy)
                return false;

            if (turn >= password.Length)
                return true;

            return password[turn];
        }

        public bool Reset()
        {
            turn = 0;
            isEnemy = false;
            return password[0];
        }

    }
}
